import { INIT_TOKEN } from "../actionTypes";
import axios from "axios"
export const loginAction = (params) => {
  return (dispatch) => {
    axios
      .get("http://s.linweiqin.com/api/s/loginCheck", {
        params: {
          username: params.username,
          password: params.password,
        },
      })
      .then((res) => {
        dispatch({
          type: INIT_TOKEN,
          payload: {
            oauth_token: res.data.wdata.oauth_token,
          },
        });
      });
  };
};
